package main

import (
	"fmt"
	"os"
	"os/signal"
	"syscall"
)

// 监听全部信号
func main() {
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGHUP, syscall.SIGSEGV)
	fmt.Println("启动")
	s := <-c
	fmt.Println("退出信号", s)
}
